package com.ucode.dcse;

import java.util.Objects;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.ucode.dcse.handler.TableDataHandlerContext;
import com.ucode.tool.disruptor.DisruptorHandleService;

@Component("canalSyncEsDisruptorHandleService")
public class CanalSyncEsDisruptorHandleService implements DisruptorHandleService{

    @Autowired
    private TableDataHandlerContext tableDataHandlerContext;
    
    @Override
    public void execute(Object data) {
        if(!Objects.isNull(data)){
            TableCanalData  tableCanalData = (TableCanalData)data;
            tableDataHandlerContext.handle(tableCanalData);
        }
    }

}
